package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.Role;
import com.zzyl.vo.RoleVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
    /**
     * 角色管理
     * @param roleName
     * @return
     */
    Page<Role> list(String roleName);

    /**
     * 角色添加
     * @param bean
     * @return
     */
    Boolean insert(Role bean);

    /**
     * 根据id查询角色信息
     * @param roleIds
     * @return
     */
    @Select("select * from sys_role where id = #{roleIds};")
    Role selectById(String roleIds);

    /**
     * 删除角色信息
     * @param roleIds
     */
    @Delete("delete from sys_role where id = #{roleIds}")
    void delete(String roleIds);

    /**
     * 更新角色信息
     * @param bean
     * @return
     */
    Boolean update(Role bean);

    /**
     * 角色下拉框
     * @return
     */
    @Select("select * from sys_role")
    List<RoleVo> findAll();
}
